//
// Created by Administrator on 2021/5/22.
//

#include "iostream"

using namespace std;

int main(){

    //1.
    int arr[2][3];
    arr[0][0] = 1;
    arr[0][1] = 2;
    arr[0][2] = 3;
    arr[1][0] = 4;
    arr[1][1] = 5;
    arr[1][2] = 6;

//    cout << arr[0][1] << endl;

    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            cout << arr[i][j] << " ";
        }
    }
    cout <<endl;

    //2.
    int arr2[2][3] ={
            {1, 2, 3},
            {4, 5, 6}
    };
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            cout << arr2[i][j] << " ";
        }
    }
    cout << endl;

    //3.
    int arr3[2][3] = {1, 2, 3, 4, 5, 6};
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            cout << arr3[i][j] << " ";
        }
    }
    cout << endl;

    //4.
    int arr4[][3] = {1, 2, 3, 4, 5, 6};
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 3; j++) {
            cout << arr3[i][j] << " ";
        }
    }
    cout << endl;
    cout << "sizeof: " << sizeof(arr4) <<endl;
    cout << "first cl: " << sizeof(arr4[0]) << endl;
    cout << "first number: " << sizeof(arr4[0][0]) << endl;

    cout << "line number: " << sizeof(arr4) / sizeof(arr4[0]) << endl;
    cout << "columns number: " << sizeof(arr4[0]) / sizeof(arr4[0][0]) << endl;

    cout << "first address: " << (int)arr4 << endl;
    cout << "first line address: " <<(int)arr4[0] << endl;
    cout << "second line address: " << (int)arr4[1] << endl;
    cout << "first number address: " << (int)&arr4[0][0] << endl;
    cout << "second number address: " << (int)&arr4[0][1] << endl;

    system("pause");

    return 0;
}